<?php 
if($_POST['action'] == 'logout_user')
{
	if(($_SESSION['userid'] != '') || ($_SESSION['username'] != ''))
	{
		$error = logoutUser($_SESSION['userid'], $_SESSION['username']);
	}
	$error[0] = '<font class="com_txt_err">'.$error[0].'</font>';
	$error[1] = '<font class="com_txt_err">'.$error[1].'</font>';
}
if($_SESSION['logged'] < 1)
{include('modules/mod_users/login_box.php');}
else
{
?>
<form id="logout_user" action="" method="post" enctype="multipart/form-data" name="logout_user">
<?php 
$module[2]=getModTemplate(2);

if($module[2]['icon'] > 0)
{ $module[2]['icon'] = getIcon($module[2]['icon_set'], $module[2]['icon_image'], $module[2]['icon_style']); }
else
{ $module[2]['icon'] = ""; }

$user = getUser($_SESSION['userid']);
$footer_buttons = array 
(
	'0' => array 
	(	'type' => '3',
		'text' => 'Logout',
		'link' => '',
		'action' => "document.getElementById('logout_user').submit();",
		'submit' => '',
		'other' => '',
		'id' => '',
	),
	'1' => array 
	(	'type' => '3',
		'text' => 'Edit Account',
		'link' => 'index.php?com_id=4',
		'action' => '',
		'submit' => '',
		'other' => '',
		'id' => '',
	),
);
if($module[2]['border'] > 0)
{ require('templates/borders/type_'.$module[2]['border'].'_top.php'); }
echo getHeader($module[2]['header'], 'Welcome', $user->getUsername(), 0, $module[2]['icon']);
if($module[2]['border2'] > 0)
{ require('templates/borders/type_'.$module[2]['border2'].'_top.php'); }
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="mod_table_form">
	<tr>
		<td valign="top" colspan="2" align="left" class="<?php echo $module[2]['class'] ;?>_txt" style="padding: 4px;">
			<input class="<?php echo $module[2]['class'] ;?>_input" type="hidden" name="action" value="logout_user" />
		</td>
	</tr>
	<tr>
		<td valign="top" colspan="2" align="left" class="<?php echo $module[2]['class'] ;?>_txt" style="padding: 4px;">
			<img src="<?php echo USER_IMAGE_THUMB_URL.$user['image'] ;?>" border="0" alt="profile_image" />
		</td>
	</tr>
</table>
<?php 
if($module[2]['border2'] > 0)
{ require('templates/borders/type_'.$module[2]['border2'].'_bot.php'); }
echo getFooter($module[2]['footer'], '', $footer_buttons);
if($module[2]['border'] > 0)
{ require('templates/borders/type_'.$module[2]['border'].'_bot.php'); }
?>
</form>
<?php 
}
?>


